<?php
/**
* Display the summary of transactions
*
* @author       Fabrice Douteaud <admin@clearbudget.net>
* @package      snippets
* @access       public
*/

/***********************************************************************

  Copyright (C) 2008  Fabrice Douteaud (admin@clearbudget.net)

    This file is part of ClearBudget.

    ClearBudget is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ClearBudget is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ClearBudget.  If not, see <http://www.gnu.org/licenses/>.


************************************************************************/
//prevent direct access
if(!defined('ENGINEON')) die('Direct access forbidden');

class_debug::addMsg(__FILE__, 'start building table layout', DEBUGDEBUG);
?>
<div class="tableDiv">
<table>
<caption></caption>
<tr>
  <td>
    <img src="<?php echo $url1; ?>" alt="" border="1" style="width:500px;height:200px;border:1px" />
  </td>
  <td>
    <img src="<?php echo $url2; ?>" alt="" border="1" style="width:400px;height:150px;border:1px" />
  </td>
</tr>
</table>
<table class="tableReport">
<caption><?php echo $keys->tableTitle_overview; ?></caption>
<tr><th>&nbsp;</th>
<?php
foreach($dates as $date) {
  echo '<th class="nobg">'.$date.'</th>';
  }
?>
 <th><?php echo $keys->text_Total; ?></th>
</tr>
<tr><td class="category"><?php echo $keys->text_Credit ?></td>
<?php
    // start the row
  foreach($dates as $date) {
    if(isset($credits[$date])) echo '<td>'.$report->formatNumber($credits[$date]).'</td>';
    else echo '<td>'.$report->formatNumber(0).'</td>';
    }
  // print the total and average
  echo '<td class="total">'.$report->formatNumber(($totalCredits)).'</td>';
 ?>
</tr>
<tr><td class="category"><?php echo $keys->text_Debit ?></td>
<?php
    // start the row
  foreach($dates as $date) {
    if(isset($debits[$date])) echo '<td>'.$report->formatNumber($debits[$date]).'</td>';
    else echo '<td>'.$report->formatNumber(0).'</td>';
    }
  // print the total and average
  echo '<td class="total">'.$report->formatNumber($totalDebits).'</td>';
 ?>
</tr>
</table>
</div>
<?php
class_debug::addMsg(__FILE__, 'end building table layout', DEBUGDEBUG);
?>